﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class UIEvent : MonoBehaviour {

	// Use this for initialization
	void Start () {
        //Button btn = this.GetComponent<Button>();
        //UIEventListener btnListener = btn.gameObject.AddComponent<UIEventListener>();
        //btnListener.OnClick += BtnListener_OnClick;
        EventManager.StartListening("test", Do);
	}

    private void Do(GameObject arg0, string arg1)
    {
        Debug.Log("DoSth!");
    }

    private void BtnListener_OnClick(GameObject go)
    {
        Debug.Log(go.name + "On Click!");
        EventManager.TriggerEvent("test",null,"");
    }

    // Update is called once per frame
    void Update () {
		
	}
}
